<?php
ob_start();
include("databaseconnection.php");
include("header.php");
?>

<?php
/*include("config.php");
	echo $_SESSION['userid']=$row['ID']; */
?>
<form id="form1" name="form1" method="post" action="userregedu.php?action=save" >
  <table width="600" cellspacing="0" cellpadding="0">
   
     <tr>
    <td>Institution:</td>
    <td>
    <select name="Institutiontype"  >
    <option value='<?php  $Institutiontype ?>'><?php  $Institutiontype?></option>
    <?php
    $result=mysql_query("SELECT * FROM institution ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['INSTITUTION_NAME']."'>".$row['INSTITUTION_NAME']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
    
    <tr>
    <td>Designation</td>
    <td>
    <select name="Designationtype"  >
    <option value='<?php  $Designationtype ?>'><?php  $Designationtype?></option>
    <?php
    $result=mysql_query("SELECT * FROM designation ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_DESIGNATION']."'>".$row['NAME_DESIGNATION']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
  
  
  <tr>
    <td>Edu_Qualification</td>
    <td>
    <select name="edu_qualification"  >
    <option value='<?php  $edu_qualification ?>'><?php  $edu_qualification?></option>
    <?php
    $result=mysql_query("SELECT * FROM edu_qualification ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_EDU_QUALIFICATION']."'>".$row['NAME_EDU_QUALIFICATION']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
    
 
 
  <tr>
    <td>Appointment Subject</td>
    <td>
    <select name="Subjecttype"  >
    <option value='<?php  $Subjecttype ?>'><?php  $Subjecttype?></option>
    <?php
    $result=mysql_query("SELECT * FROM appointment_subject ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_APPOINTMENT_SUBJECT']."'>".$row['NAME_APPOINTMENT_SUBJECT']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
  
  <tr>
      <td width="199">Appointment Year:</td>
      <td width="399"><select name="Appointment_year">
      <option value="1980">1980</option>
      <option value="1981">1981</option>
      <option value="1982">1982</option>
      <option value="1983">1983</option>
      <option value="1984">1984</option>
      <option value="1985">1985</option>
      <option value="1986">1986</option>
      </select>	
    </td>
    </tr>
  
    
     <tr>
    <td>Division</td>
    <td>
    <select name="divisiontype"  >
    <option value='<?php  $divisiontype ?>'><?php  $divisiontype?></option>
    <?php
    $result=mysql_query("SELECT * FROM division ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_DIVISION']."'>".$row['NAME_DIVISION']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
  
    <tr>
    <td>Zone</td>
    <td>
    <select name="zonetype"  >
    <option value='<?php  $zonetype ?>'><?php  $zonetype?></option>
    <?php
    $result=mysql_query("SELECT * FROM zone ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_ZONE']."'>".$row['NAME_ZONE']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
    
    
    <tr>
    <td>District</td>
    <td>
    <select name="Districttype"  >
    <option value='<?php  $Districttype ?>'><?php  $Districttype?></option>
    <?php
    $result=mysql_query("SELECT * FROM district ");
	while ($row=mysql_fetch_array($result))
	{
		echo "<option value='".$row['NAME_DISTRICT']."'>".$row['NAME_DISTRICT']."</option>";
		
	}
	
    ?>
    </select>
    </td>
  </tr>
    
    <tr>
    
    
    
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Submit" /></td>
    </tr>
    
  </table>

</form>
<?php
if($_GET['action']== "save")
{
	echo $g_Institutiontype=$_POST['Institutiontype'];
	echo $g_Designationtype=$_POST['Designationtype'];
	echo $g_edu_qualification=$_POST['edu_qualification'];
	
	echo $g_Appointment_year=$_POST['Appointment_year'];
	echo $g_Subjecttype=$_POST['Subjecttype'];
	echo $g_divisiontype=$_POST['divisiontype'];
	echo $g_zonetype=$_POST['zonetype'];
	echo $g_Districttype=$_POST['Districttype'];
	

		
		mysql_query("INSERT INTO participant   (INSTITUTION,DESIGNATION,EDU_QUALIFICATION,APPOINTMENT_YEAR,APPOINTMENT_SUBJECT,DIVISION,ZONE,DISTRICT) VALUES('$g_Institutiontype','$g_Designationtype','edu_qualification','$g_Appointment_year','$g_Subjecttype','$g_divisiontype','$g_zonetype','$g_Districttype') ") or die(mysql_error());
		
		echo "registed";
		session_start();
		header("location:userregoffi.php");
		exit;
		
			

	
	}
	
?>

<?php
include("fooder.php");
	
?>
